Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#07c160",
    list: [
      {
        pagePath: "/pages/index/index",
        text: "发起审批",
        iconPath: "/assets/icons/create.png",
        selectedIconPath: "/assets/icons/create-active.png"
      },
      {
        pagePath: "/pages/approvalList/approvalList",
        text: "审批列表",
        iconPath: "/assets/icons/list.png",
        selectedIconPath: "/assets/icons/list-active.png"
      },
      {
        pagePath: "/pages/todoList/todoList",
        text: "待办事项",
        iconPath: "/assets/icons/todo.png",
        selectedIconPath: "/assets/icons/todo-active.png"
      }
    ]
  },

  methods: {
    switchTab(e: any) {
      const data = e.currentTarget.dataset;
      const url = data.path;
      wx.switchTab({ url });
      this.setData({
        selected: data.index
      });
    }
  }
}); 